package com.sannuo.system.service.impl;

import com.sannuo.common.domain.Menu;
import com.sannuo.common.domain.Role;
import com.sannuo.common.domain.RoleMenu;
import com.sannuo.system.dao.RoleMapper;
import com.sannuo.system.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl  implements RoleService {

    @Autowired
    private RoleMapper roleMapper;



    @Override
    public List<Role> selectRole() {
        return roleMapper.selectRole();
    }

    @Override
    public int addRole(Role role) {
        return roleMapper.addRole(role);
    }

    @Override
    public List<Role> selectRoleById(Integer i) {
        return roleMapper.selectRoleById(i);
    }

    @Override
    public List<Menu> menu_Role() {
        return roleMapper.menu_Role();
    }

    @Override
    public List<Menu> selectMenus(Integer id) {
        return roleMapper.selectMenus(id);
    }

    @Override
    public List<RoleMenu> selectRoleMenu(Integer id) {
        return roleMapper.selectRoleMenu(id);
    }

    @Override
    public int deleteRoleMenu(int roleId) {
        return roleMapper.deleteRoleMenu(roleId);
    }

    @Override
    public int addRoleMenu(int roleId,int menuId) {
        return roleMapper.addRoleMenu(roleId,menuId);
    }

    @Override
    public int RoleUpdate(Role role) {
        return roleMapper.RoleUpdate(role);
    }


}
